import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Color;
import java.awt.Font;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class Debugger extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JTextArea debug;
	private Calendar cal;

	public Debugger(int x, int y, int height) {
		cal = new GregorianCalendar();
		setTitle("DEBUGGER");
		// setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(x, y, 400, height);
		debug = new JTextArea();
		debug.setFont(new Font("Consolas", Font.PLAIN, 11));
		debug.setBackground(new Color(51, 51, 51));
		debug.setForeground(new Color(0, 0, 0));
		JScrollPane scrollPane = new JScrollPane(debug);
		scrollPane.setPreferredSize(new Dimension(400, height));
		getContentPane().add(scrollPane, BorderLayout.CENTER);
	}

	public void msg(String text) {
		cal = new GregorianCalendar();
		debug.append(cal.get(Calendar.HOUR_OF_DAY) + ":"
				+ cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND)
				+ ":" + cal.get(Calendar.MILLISECOND) + " " + "> " + text
				+ "\n");
	}

}
